package change;
import java.util.Scanner; 

public class change {

	public static void main(String[] args) {
		
		Scanner n =new Scanner (System.in 

);
		
		while (n.hasNext()){
		String a =n.nextLine();
		int b = Integer.parseInt(a);
		if( b>=10000&&b<=20000){
			String str1 = Integer.toBinaryString(b);
			System.out.print(str1);
			System.out.print(',');
			String str2 = Integer.toOctalString(b);
			System.out.print(str2);
			System.out.print(',');
			String str3 = Integer.toHexString(b);
			System.out.println(str3);
		}
		else if(b>=0){
			int[] num=new int[10];
			int sum=0;
			int i=0;
			if(b==0){
				sum=0;
				num[i]=0;
				System.out.print(num[i]);
				System.out.print(' ');
			}
			else {
				while(b>=1){
				num[i]=b%10;
				sum+=num[i];
				b=(b-num[i])/10;
				i++;
			}
			i-=1;
			while(i>=0){
				System.out.print(num[i]);
				System.out.print(' ');
				i--;
			}
			}
			System.out.println(sum);
		}
		else{
			b=b*(-1);
			int[] num=new int[10];
			int sum=0;
			int i=0;
			while(b>=1){
				num[i]=b%10;
				sum+=num[i];
				b=(b-num[i])/10;
				i++;
			}
			i-=1;
			while(i>=0){
				System.out.print(num[i]);
				System.out.print(' ');
				i--;
			}
			System.out.println(sum);
		}
		
	}
}
}
